package com.stone.controller;


import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    public String name = "张三";

    public static void main(String[] args) {
        System.err.println(1 << 4);
    }

    @Transactional(
            propagation = Propagation.REQUIRED,
            isolation = Isolation.SERIALIZABLE,
            timeout = 5,
            readOnly = false,
            rollbackFor = {Exception.class},
            noRollbackFor = {Exception.class})
    public void test() {
        // 业务代码
    }

    @GetMapping("test")
    public void test2() {
        Singleton.INSTANCE.businessMethod();
    }

}
